<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
	</head>
	<body>
		<div class="aui-content">
			<ul class="aui-list" id="list"></ul>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/util.js"></script>
	<script type="text/javascript" src="../../script/doT.js"></script>
	<script id="textTemplate" type="text/x-dot-template">
		<li class="aui-list-header">
		结果如下
		</li>
		<li class="aui-list-item">
		<div class="aui-media-list-item-inner aui-content-padded">
		<div class="aui-list-item-inner">
		<div class="aui-list-item-text">{{=it.msg}}</div>
		</div>
		</div>
		</li>
	</script>
	<script type="text/javascript">
		apiready = function() {
			api.parseTapmode();
			// 二维码按钮
			var scanner = api.require('scanner');
			scanner.open(function(ret, err) {
				var msg = ret.msg;
				if (ret) {
					if (isUrl(msg)) {
						openBrowse(ret.msg, "扫描结果", true, "http");
						api.closeWin({
						});
					} else {
						console.log(JSON.stringify(ret));
						var template = $api.byId('textTemplate');
						var text = $api.byId('list');
						var pagefn = doT.template(template.text);
						$api.html(text, pagefn(ret));
					}
				}
			});
		};
	</script>
</html>